public class Transaction extends Object implements XMLMarshallable
Java class represents a rated transaction computed by the SAP CC system during the dynamic
pricing of a customer service use (service usage by an end customer, periodic fees, or one-off fees).
A rated transaction includes:
subscriptionCode)offerCode) transaction details notifications assigned to this rated transaction
Refer to transaction details for more information.
Transaction details can be filtered if the transaction is generated by a stateful operation and for a provider contract.
The transaction detail filtering is configured through the
Response Item from the Charge Plan.
Consult the SAP CC Application Help from more information about the charging process.
Purchase orders (in case of stateless rating services),
Charged transaction sets (in case of stateful charging services)The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="transac" type="TransactionType"/>
<xs:complexType name="TransactionType">
<xs:sequence>
<xs:element name="detail" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="value" type="xs:anySimpleType"/>
</xs:complexType>
</xs:element>
<xs:element ref="notification" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="amount" type="xs:string"/>
<xs:attribute name="offerCode" type="xs:string"/>
<xs:attribute name="chargePlanId" type="xs:string"/>
<xs:attribute name="subscriptionCode" type="xs:string"/>
<xs:attribute name="chargingContractId" type="xs:string"/>
<xs:attribute name="chargeCode" type="xs:string"/>
<xs:attribute name="dispatchCode1" type="xs:string"/>
<xs:attribute name="dispatchCode2" type="xs:string"/>
<xs:attribute name="dispatchCode3" type="xs:string"/>
<xs:attribute name="origin" type="TransactionOrigin"/>
<xs:attribute name="date" type="xs:dateTime"/>
<xs:attribute name="label" type="xs:string"/>
<xs:attribute name="relationshipType" type="TransacRelationShipTypeType" default="client"/>
<xs:attribute name="operationType" type="TransacOperationTypeType" default="debit"/>
<xs:attribute name="reservationUID" type="xs:long"/>
<xs:attribute name="sessionID" type="xs:string"/>
</xs:complexType>
<xs:simpleType name="TransactionOrigin">
<xs:restriction base="xs:string">
<xs:enumeration value="usage"/>
<xs:enumeration value="recurring"/>
<xs:enumeration value="oneshot"/>
<xs:enumeration value="accountEvent"/>
</xs:restriction>
</xs:simpleType><xs:simpleType name="TransacRelationShipTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="client"/>
<xs:enumeration value="partner"/>
</xs:restriction>
</xs:simpleType><xs:simpleType name="TransacOperationTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="debit"/>
<xs:enumeration value="credit"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static int |
ACCOUNT_EVENT
Constant value of the origin field indicating an account event refill transaction
|
static int |
CLIENT_RELATIONSHIP
Constant value for a client type business relationship
|
static int |
CREDIT_OPERATION
Constant value for a credit operation
|
static int |
DEBIT_OPERATION
Constant value for a debit operation
|
static int |
ONESHOT
Constant value of the origin field indicating a one-shot transaction
|
static int |
PARTNER_RELATIONSHIP
Constant value for a partner type business relationship
|
static int |
RECURRING
Constant value of the origin field indicating a recurring transaction
|
static int |
USAGE
Constant value of the origin field indicating a usage transaction
|
| Constructor and Description |
|---|
Transaction()
Builds an empty transaction
|
Transaction(Money amount,
String offerCode,
String subscriptionCode,
String chargeCode,
String dispatchCode1,
String dispatchCode2,
String dispatchCode3,
int origin,
DetailRecord detailRecord,
Date date,
String label)
Builds a full transaction with neither
reservationUID nor
sessionID |
Transaction(Money amount,
String offerCode,
String subscriptionCode,
String chargeCode,
String dispatchCode1,
String dispatchCode2,
String dispatchCode3,
int origin,
DetailRecord detailRecord,
Date date,
String label,
Long reservationUID,
String sessionID)
Builds a full transaction
|
Transaction(Money amount,
String offerCode,
String subscriptionCode,
String chargeCode,
String dispatchCode1,
String dispatchCode2,
String dispatchCode3,
int origin,
DetailRecord detailRecord,
Date date,
String label,
Long reservationUID,
String sessionID,
String internalSessionID,
Vector<Notification> notifications) |
Transaction(TransactionTemplateModel template)
Builds an empty transaction with a
template which will determine how to filter the transaction |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
Transaction |
duplicate()
Duplicates the transaction
|
Transaction |
duplicateWithoutDetailRecord()
Duplicate the transaction without the detail record.
|
Money |
getAmount()
Gets the amount of the transaction generated by the SAP CC system
|
String |
getChargeCode()
Returns the identification code of the charge
|
String |
getChargePlanId()
Gets the identifier of the charge plan activated in the relating provider contract
(in case of charging services based on provider contracts)
|
String |
getChargingContractId()
Gets the identifier of the charging contract associated to this rated transaction (see provider contract)
|
Date |
getDate()
Gets the date
|
DetailRecord |
getDetailRecord()
Gets the detail record included in the transaction
|
String |
getDispatchCode1()
Gets the dispatch code number 1
|
String |
getDispatchCode2()
Gets the dispatch code number 2
|
String |
getDispatchCode3()
Gets the dispatch code number 3
|
String |
getInternalSessionID()
Gets the session internal id related to this transaction when it has been
computed by session-based rating operations.
|
String |
getLabel()
Returns the label
|
Transaction |
getMasterTransaction()
Gets the master transaction for this transaction
|
Vector<Notification> |
getNotifications()
Gets the list of triggered notifications
|
String |
getOfferCode()
Gets the identification code of the related
commercial offer if the transaction
results from charging services based on subscriptions. |
int |
getOperationType()
Gets the operation type of the transaction
|
int |
getOrigin()
|
int |
getRelationshipType()
Gets the relationship type of the transaction
|
Long |
getReservationUID()
Gets the reservation ID related to this transaction when it has been
computed by a
PreRateOp or PostRateOp. |
String |
getSessionID()
Gets the session identifier related to this transaction when it has been
computed by session-based charging operations.
|
String |
getSubscriptionCode()
Gets the identification code of the
subscription associated to this rated transaction |
Transaction |
getTransaction(boolean isFilterTransaction)
Gets the transaction according to the value of the option: isFilterTransaction
|
TransactionTemplateModel |
getTransactionTemplate()
Gets the transaction template which determines the filtering
|
boolean |
isFree()
Checks if transaction is free, i.e.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
marshal(XMLOutputter output,
String tagName) |
void |
setAmount(Money amount)
Sets the amount
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setChargeCode(String code)
Sets the charge code
|
void |
setChargePlanId(String chargePlanId)
Sets the identifier of the charge plan
|
void |
setChargingContractId(String chargingContractId)
Sets the identifier of the charging contract (charging view of a provider contract)
|
void |
setDate(Date date)
Sets the date
|
void |
setDetailRecord(DetailRecord record)
Sets the detail record
|
void |
setDispatchCode1(String code)
Sets the dispatch code number 1
|
void |
setDispatchCode2(String code)
Sets the dispatch code number 2
|
void |
setDispatchCode3(String code)
Sets the dispatch code number 3
|
void |
setInternalSessionID(String internalSessionID)
Sets the session internal id related to this transaction when it has been
computed by session-based rating operations.
|
void |
setLabel(String label)
Sets the label
|
void |
setMasterTransaction(Transaction masterTransaction)
Sets the master transaction for this transaction
|
void |
setNotifications(Vector<Notification> notifications)
Sets the list of triggered notifications
|
void |
setOfferCode(String code)
Sets the identification code of the offer
|
void |
setOperationType(int type)
Sets the operation type for the transaction
|
void |
setOrigin(int origin)
Sets the origin
|
void |
setRelationshipType(int relationshipType)
Sets the relationship type of the transaction
|
void |
setReservationUID(Long reservationUID)
Sets the reservation ID related to this transaction when it has been
computed by a
PreRateOp or PostRateOp operation request. |
void |
setSessionID(String sessionID)
Sets the session ID related to this transaction when it has been
computed by session-based charging operations.
|
void |
setSubscriptionCode(String code)
Sets the subscription code
|
String |
toString() |
public static final int USAGE
public static final int RECURRING
public static final int ONESHOT
public static final int ACCOUNT_EVENT
public static final int CLIENT_RELATIONSHIP
public static final int PARTNER_RELATIONSHIP
public static final int DEBIT_OPERATION
public static final int CREDIT_OPERATION
public Transaction()
public Transaction(TransactionTemplateModel template)
template which will determine how to filter the transactiontemplate - The manner to filter transactionpublic Transaction(Money amount, String offerCode, String subscriptionCode, String chargeCode, String dispatchCode1, String dispatchCode2, String dispatchCode3, int origin, DetailRecord detailRecord, Date date, String label)
reservationUID nor
sessionIDamount - offerCode - subscriptionCode - chargeCode - dispatchCode1 - dispatchCode2 - dispatchCode3 - origin - detailRecord - date - label - public Transaction(Money amount, String offerCode, String subscriptionCode, String chargeCode, String dispatchCode1, String dispatchCode2, String dispatchCode3, int origin, DetailRecord detailRecord, Date date, String label, Long reservationUID, String sessionID)
amount - offerCode - subscriptionCode - chargeCode - dispatchCode1 - dispatchCode2 - dispatchCode3 - origin - detailRecord - date - label - reservationUID - sessionID - public Transaction(Money amount, String offerCode, String subscriptionCode, String chargeCode, String dispatchCode1, String dispatchCode2, String dispatchCode3, int origin, DetailRecord detailRecord, Date date, String label, Long reservationUID, String sessionID, String internalSessionID, Vector<Notification> notifications)
public Transaction getTransaction(boolean isFilterTransaction)
isFilterTransaction - true if the returned transaction must be
filtered, false otherwisepublic final Transaction duplicate()
public final Transaction duplicateWithoutDetailRecord()
public Money getAmount()
public void setAmount(Money amount)
amount - The amount to setpublic boolean isFree()
null.true if the transaction is free, false otherwisepublic String getOfferCode()
commercial offer if the transaction
results from charging services based on subscriptions.public void setOfferCode(String code)
code - The transaction offer codepublic String getChargePlanId()
public void setChargePlanId(String chargePlanId)
chargePlanId - The identifier of the charge planpublic String getSubscriptionCode()
subscription associated to this rated transactionpublic void setSubscriptionCode(String code)
code - The subscription codepublic String getChargingContractId()
public void setChargingContractId(String chargingContractId)
chargingContractId - The identifier of the charging contractpublic String getChargeCode()
public void setChargeCode(String code)
code - The charge codepublic String getDispatchCode1()
public void setDispatchCode1(String code)
code - The dispatch code 1public String getDispatchCode2()
public void setDispatchCode2(String code)
code - The dispatch code 2public String getDispatchCode3()
public void setDispatchCode3(String code)
code - The dispatch code 3public int getOrigin()
usage (service consumtpion), recurring (periodic fees), or one-shot (one-offf fees).public void setOrigin(int origin)
origin - The transaction originpublic DetailRecord getDetailRecord()
detail recordpublic void setDetailRecord(DetailRecord record)
record - The transaction detail recordpublic Date getDate()
public void setDate(Date date)
date - The transaction datepublic String getLabel()
public void setLabel(String label)
label - The transaction labelpublic TransactionTemplateModel getTransactionTemplate()
public int getRelationshipType()
CLIENT_RELATIONSHIP,
PARTNER_RELATIONSHIPpublic void setRelationshipType(int relationshipType)
relationshipType - The value to assign to the relationship typeCLIENT_RELATIONSHIP,
PARTNER_RELATIONSHIPpublic int getOperationType()
DEBIT_OPERATION,
CREDIT_OPERATIONpublic void setOperationType(int type)
type - The value to assign to operation typeDEBIT_OPERATION,
CREDIT_OPERATIONpublic Long getReservationUID()
PreRateOp or PostRateOp.public void setReservationUID(Long reservationUID)
PreRateOp or PostRateOp operation request.reservationUID - The reservation ID related to this transactionpublic String getSessionID()
public void setSessionID(String sessionID)
sessionID - The session ID related to this transactionpublic String getInternalSessionID()
public void setInternalSessionID(String internalSessionID)
internalSessionID - the session internal id related to this transactionpublic Vector<Notification> getNotifications()
notifications triggered and included in this resulting transaction by the SAP CC systempublic void setNotifications(Vector<Notification> notifications)
notifications - The list of triggered notificationspublic Transaction getMasterTransaction()
null otherwisepublic void setMasterTransaction(Transaction masterTransaction)
masterTransaction - The master transaction of this transactionpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic void marshal(XMLOutputter output, String tagName)